﻿using System;

class FindingBitThree
{
    static void Main()
    {
        Random p = new Random();
        int bitPosition = 3;
        int number = p.Next(100);
        int mask = (1 << bitPosition);
        int numberAndMask = (number & mask);
        int bitValue = (numberAndMask >> bitPosition);
        Console.WriteLine("The bit at position 3 of the number {0} is {1}", number, bitValue);
    }
}
